<%@ Control Language="C#" AutoEventWireup="true"
	Inherits="System.Web.Mvc.ViewUserControl<HomeBanking.ApplicationServices.ViewModels.CuentasFormViewModel>" %>
<%@ Import Namespace="HomeBanking.Core" %>
<%@ Import Namespace="HomeBanking.Web.Controllers" %>
 

<% if (ViewContext.TempData[ControllerEnums.GlobalViewDataProperty.PageMessage.ToString()] != null) { %>
    <p id="pageMessage"><%= ViewContext.TempData[ControllerEnums.GlobalViewDataProperty.PageMessage.ToString()]%></p>
<% } %>

<%= Html.ValidationSummary() %>

<% using (Html.BeginForm()) { %>
    <%= Html.AntiForgeryToken() %>
    <%= Html.Hidden("Cuentas.Id", (ViewData.Model.Cuentas != null) ? ViewData.Model.Cuentas.Id : 0)%>

    <ul>
		<li>
			<label for="Cuentas_Numero">Numero:</label>
			<div>
				<%= Html.TextBox("Cuentas.Numero", 
					(ViewData.Model.Cuentas != null) ? ViewData.Model.Cuentas.Numero.ToString() : "")%>
			</div>
			<%= Html.ValidationMessage("Cuentas.Numero")%>
		</li>
		<li>
			<label for="Cuentas_Saldo">Saldo:</label>
			<div>
				<%= Html.TextBox("Cuentas.Saldo", 
					(ViewData.Model.Cuentas != null) ? ViewData.Model.Cuentas.Saldo.ToString() : "")%>
			</div>
			<%= Html.ValidationMessage("Cuentas.Saldo")%>
		</li>
	    <li>
            <%= Html.SubmitButton("btnSave", "Save Cuentas") %>
	        <%= Html.Button("btnCancel", "Cancel", HtmlButtonType.Button, 
				    "window.location.href = '" + Html.BuildUrlFromExpressionForAreas<CuentasController>(c => c.Index()) + "';") %>
        </li>
    </ul>
<% } %>
